package com.mmz.dao;

import javax.annotation.Resource;

import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.springframework.stereotype.Repository;

import com.mmz.domain.Product;
@Repository
public class ProductDao {
	@Resource
	private SqlSessionFactory sqlSessionFactory;
	
	public SqlSessionFactory getSqlSessionFactory() {
		return sqlSessionFactory;
	}

	public void setSqlSessionFactory(SqlSessionFactory sqlSessionFactory) {
		this.sqlSessionFactory = sqlSessionFactory;
	}

	public void save(Product product){
		System.out.println("ProductDao");
		SqlSession sqlSession = sqlSessionFactory.openSession();
		sqlSession.insert("empNamespace.save",product);
	}
}
